<template>
  <view class="" style="display: flex;">
  	<view>
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">培训开始日期</view>
  			<!-- <view class="rl">{{ filterMultiDictText(dictOptions['postId'], item.postId + '') }}</view> -->
  			<view class="rl">{{ item.beginDate }}</view>
  		</view>
  		<view class="option" style="width: 520rpx;">
  			<view class="lf">培训结束日期</view>
  			<view class="rl">{{ item.endDate }}</view>
  		</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">培训机构</view>
				<view class="rl">{{ item.institution }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">培训项目</view>
				<view class="rl">{{ item.project }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">取得证书名称</view>
				<view class="rl">{{ item.certificate }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">培训服务期限</view>
				<view class="rl">{{ item.trainingServiceLimit_dictText }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">服务期限起止时间</view>
				<view class="rl">{{ item.serviceStartDate }}-{{ item.serviceEndDate }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">培训费用(元)</view>
				<view class="rl">{{ item.trainingFee }}</view>
			</view>
			<view class="option" style="width: 520rpx;">
				<view class="lf">剩余应扣款(元)</view>
				<view class="rl">{{ item.remainingDeductions }}</view>
			</view>
  	</view>
  	<!-- <view  style="flex: 1; display: flex; align-items: center; justify-content: flex-end;">
  		<u-icon name="edit-pen-fill" color="#2979ff" size="20" @click="handleEidtForm(item)"></u-icon>
  		<u-line  direction="col" length="20" margin="0 10rpx"></u-line>
  		<u-icon name="trash-fill" color="#2979ff" size="20" @click="handleRemoveForm(item)"></u-icon>
  	</view> -->
  </view>
</template>

<script>
import { filterMultiDictText, initDictOptions } from '@/utils/JDictSelectUtil.js'
export default {
  name: 'TrainingCutPaymentInfo',
  props: {
    index: {
      type: Number,
      default: null,
    },
    item: {
      type: Object,
      default: () => ({}),
    }
  },
  data() {
    return {
      filterMultiDictText,
      initDictOptions,
      dictOptions: {},
    }
  },
  watch: {
    item: {
      handler(val) {
        if (val) {
          // this.initDictConfig()
        }
      },
      immediate: true,
      deep: true,
    },
  },
  methods: {
		initDictConfig() {
			initDictOptions('sys_position,name,id,del_flag = 0 and audit_status=2').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'postId', res.result)
				}
			})
			initDictOptions('educational_requirements').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'educationalRequirements', res.result)
				}
			})
			initDictOptions('sex_requirements').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'sexRequirements', res.result)
				}
			})
			initDictOptions('professional_requirement').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'professionalRequirement', res.result)
				}
			})
			initDictOptions('work_experience').then((res) => {
				if (res.success) {
					this.$set(this.dictOptions, 'workExperience', res.result)
				}
			})
		},
    handleCopyForm(item) {
      this.$emit('copy', [item, this.index])
    },
    handleEidtForm(item) {
      this.$emit('edit', [item, this.index])
    },
    handleRemoveForm(item) {
			uni.showModal({
			  content: '确定删除吗？',
			  success: (res) => {
			    if (res.confirm) {
			      this.$emit('remove', item)
			    }
			  },
			})
    },
  }
}
</script>

<style scoped lang="scss">
.inforamtion {
  margin-top: 10rpx;
  padding: 10rpx;
  border-radius: 15rpx;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}
</style>
